package com.zhuss.product.train;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.product.train.DetailTrainBo;
import com.zhuss.bean.bo.product.train.SearchTrainBo;
import com.zhuss.common.ReadService;
import com.zhuss.product.processor.TrainRead;
import com.zhuss.exception.DzcxException;

/**
 * @description: 车次查询Service
 * @author: zhushanshuo
 * @create: Mon Jan 04 08:55:12 CST 2021
 **/
@Component("trainReadService")
public class TrainReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("trainRead")
	private TrainRead trainRead;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailTrainBo bo = (DetailTrainBo) param;
		Long trainId = bo.getTrainId();
		Object vo = trainRead.detail(trainId);
		return vo;
	}

	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchTrainBo bo = (SearchTrainBo) param;
		Object result = trainRead.list(bo);
		return result;
	}


}

